package com.xyy.saas.payment.dao.mapper;

import com.xyy.saas.payment.dao.model.ProfitSharing;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProfitSharingMapper {

    int insert(ProfitSharing entity);

    ProfitSharing selectById(Long id);

    List<ProfitSharing> selectByParam(ProfitSharing param);

    /**
     * 查询待处理的分润数据
     */
    List<ProfitSharing> selectPendingList(@Param("id") Long maxId,@Param("status") Integer status);

    int deleteById(Long id);

    /**
     * 根据主键更新
     * @param profitSharing
     * @return
     */
    int updateByPrimaryKeySelective(ProfitSharing profitSharing);

    /**
     * 根据支付平台单号查询
     * @param profitSharingNo
     * @return
     */
    ProfitSharing queryByProfitSharingNo(String profitSharingNo);

    /**
     * 根据业务单号查询
     * @param businessOrderNo
     * @return
     */
    List<ProfitSharing> queryByBusinessOrderNo(String businessOrderNo);

    /**
     * 根据业务单号和订单类型查询
     * @param businessOrderNo
     * @return
     */
    ProfitSharing queryByBusinessOrderNoAndBusinessOrderType(@Param("businessOrderType") String businessOrderType,@Param("businessOrderNo") String businessOrderNo);
}
